
package com.dhc.appbusinessfrm.ioc.presenter;

import com.dhc.appbusinessfrm.ioc.AppModule;
import com.dhc.appbusinessfrm.presenter.WelcomePresenter;
import com.dhc.appbusinessfrm.presenter.WelcomePresenterImpl;
import com.dhc.appbusinessfrm.view.activity.WelcomeActivity_;
import com.dhc.appbusinessfrm.view.activity.WelcomeInteractor;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

@Module(
        injects = WelcomeActivity_.class, addsTo = AppModule.class
)
public class WelcomePresenterModule {

    private WelcomeInteractor welcomeInteractor;

    public WelcomePresenterModule(WelcomeInteractor welcomeInteractor) {
        this.welcomeInteractor = welcomeInteractor;
    }

    @Provides
    @Singleton
    public WelcomeInteractor provideWelcomeInteractor() {
        return this.welcomeInteractor;
    }

    @Provides
    @Singleton
    public WelcomePresenter providePresenter(WelcomeInteractor welcomeInteractor) {
        return new WelcomePresenterImpl(welcomeInteractor);
    }
}
